Hello, Can anyone see what I'm doing wrong with the below code I want to print baseline info using the second print of user() but not getting values back like I would expect, is there any way of getting the date/user info without loading the baseline? Thank you.
Module m = current ModName_ mod = module(m) Baseline b = getMostRecentBaseline(m) print "dateOf: " dateOf(b) "//Prints Date\n" print "user: " user(b) "//Prints user\n" ModuleVersion mv = moduleVersion(mod, b) b = baseline(mv) print "dateOf: " dateOf(b) "//Prints Date\n" print "user: " user(b) "//<---Doesn't print user\n" delete mv /* dateOf: 02 June 2016//Prints Date user: Administrator//<---Doesn't print user dateOf: 31 December 1969//Prints Date user: //<---Doesn't print user */
EHcnck - Thu Jun 02 23:44:58 EDT 2016 |
Re: Issue printing baseline info Are you sure you want the baseline of the ModuleVersion which is what you are trying to use , which apparently doesn't have a user value |
Re: Issue printing baseline info If you have read the dxl reference manual you would have seen the operations instruction...
So if you put them in a loop works fine. So you only need a check to see if you got the data from the latest baseline. |
Re: Issue printing baseline info Costas..Aravidis - Mon Jun 06 03:08:44 EDT 2016 If you have read the dxl reference manual you would have seen the operations instruction...
So if you put them in a loop works fine. So you only need a check to see if you got the data from the latest baseline. From my reading it looks like you must have the baseline loaded for user/dateOf to return proper value. |
Re: Issue printing baseline info EHcnck - Mon Jun 06 07:16:34 EDT 2016 From my reading it looks like you must have the baseline loaded for user/dateOf to return proper value. Where doe it say that? As I have tested the for loop and works fine. So are you sure that you are reading the correct dxl manual? |
Re: Issue printing baseline info Costas..Aravidis - Mon Jun 06 07:30:07 EDT 2016 Where doe it say that? As I have tested the for loop and works fine. So are you sure that you are reading the correct dxl manual? I was unable to print the baseline info without opening it first. I would like it, so that I wouldn't have to open all the baselines within the set to get what is needed.
pragma encoding, "UTF-8"
pragma runLim, 0
/*
Debuging code use 32bit client(only)
int *::+(int *ptr1, int ofs) { int *ptr2 = ptr1; ptr2+=ofs; return ptr2 }
int *::@(int *ptr, int ofs) { int ad = *(ptr + ofs); int *ptr2 = addr_ ad; return ptr2 }
int *ccp () {
DB x = create ""
int *p = addr_ x; int *r = p @ 48
destroy x
return r
}
int *mbn (int *cc) { return cc @ 0x74 }
int *dp (int *n) { return n @ 0 }
int *nn (int *n) { return n @ 8 }
int allocatedObjects() {
int cnt = 0
int *mb = mbn ccp()
while (!null mb) { mb = nn mb; cnt++ }
return cnt
}
print "Allocated Objects Before Assigning in Declaration: " allocatedObjects() "\n"
*/
#include <\\..\DXL\includes\stringFunctions.inc>
#include <\\..\DXL\includes\version.inc>
Module m = current
if ( null(m) )
{
errorBox "This DXL must be run from a current Module."
halt
}
Skip memorySkp = create()//Garbage Collector
ModuleVersion ::= (ModuleVersion &mv, ModuleVersion mv2) {
int &ref = addr_ mv // cast to integer
int val = addr_ mv2 // cast to integer
ref = val // use integer assignment to make a reference copy ...
return mv2
}
void deleteSkipLst(Skip oObjectSkip)
{
ModuleVersion oMemSkip
for oMemSkip in oObjectSkip do
{
delete(oMemSkip)
}
delete(oObjectSkip)
}
string getProperties (ModuleVersion mv, string NameAttr) {
string AttrValue = null
ModuleProperties mp
getProperties (mv, mp)
if ( !null(mp) )
{
AttrDef ad = find(mp, NameAttr)
if ( null(ad) ) {
AttrValue = toString("!Found {" + NameAttr + "}")
} else {
noError()
AttrValue = mp.NameAttr ""
lastError()
if ( null(AttrValue) ) AttrValue = "{NULL}"
}
}
return(AttrValue)
}//End readModuleAttributes
void printCurrentModuleBSD(Module m)
// prints a list of Baseline Set Definitions which include the current Module
// and a list of Baseline Sets created for each Definition
{
if ( isBaseline(m) )
{
//Lookup for Baseline
Baseline b = baselineInfo(m)
if ( !null(b) )
{
ModuleVersion mv = moduleVersion(module(m), b)
put(memorySkp, mv, mv)//Garbage Collecting
BaselineSet cbs = baselineSet(mv)//Get BaselineSet
print toString(versionID(cbs) + ": " + annotation(cbs) + " Created by " + user(cbs) + " on " + stringOf(dateOf(cbs), userLocale(), "MM/dd/yyyy") + " BaselineSet(Open) " + isOpen(cbs) + "\n")
for mv in all cbs do
{
put(memorySkp, mv, mv)//Garbage Collecting
b = baselineInfo(load(mv, false))
if ( null(b) )
{
print toString("\tFailed !Open {" + (name mv) + " [" + (versionString mv) + "]}\n")
continue
}
print toString("\t" + (name mv) + " [" + (versionString mv) + "] Created by " + user(b) + " on " + stringOf(dateOf(b), userLocale(), "MM/dd/yyyy") + " _Revision: " + getProperties(mv, "_Revision") + "\n")
}
}
else
{
print "Null{Baseline}\n"
}
}
}
if (getDoorsClientMajorVersion >= 9.6)
{
noError
eval_("initNotDisplayedOpenModules()")
lastError
}
printCurrentModuleBSD(m)
if (getDoorsClientMajorVersion >= 9.6)
{
noError
eval_("closeNotDisplayedOpenedModules()")
lastError
}
deleteSkipLst(memorySkp)//Garbage Cleanup
//print "Allocated Objects After Deleting the assignment Outside of Declaration " allocatedObjects() "\n"
|
Re: Issue printing baseline info The loop
for baseline in module do {
...
}
does not open the baselined module. Is quite fast and you can get the date and the user. All described in the dxl reference manual. |
Re: Issue printing baseline info Costas..Aravidis - Mon Jun 06 09:58:41 EDT 2016 The loop
for baseline in module do {
...
}
does not open the baselined module. Is quite fast and you can get the date and the user. All described in the dxl reference manual. I want the baseline info for all baselines within a BaselineSet not baselines within the module. |
Re: Issue printing baseline info You still need to do the loop. I do not really understand what you try to achieve and why you are not reading the manual to see what it says. You can get the version of each module with for ModuleVersion in BaselineSet and the user and date for the baseline set with the user and dateOf perm. All the baselines will have the same user and the same dateOf. |
Re: Issue printing baseline info Costas..Aravidis - Mon Jun 06 10:10:38 EDT 2016 You still need to do the loop. I do not really understand what you try to achieve and why you are not reading the manual to see what it says. You can get the version of each module with for ModuleVersion in BaselineSet and the user and date for the baseline set with the user and dateOf perm. All the baselines will have the same user and the same dateOf.
baseline(ModuleVersion) |
Re: Issue printing baseline info If you are looking for the baseline set then the user and the date of the baselines within the baseline set can be taken from the baseline set. If you want to see the user and the date for the baseline then you need to get the version of the module (baseline) from the baseline set and then loop through the module's baselines to get the baseline needed to see the user and the date. But the user and the date of the baseline within the set it will be the same as the user and the date of the baseline set. |
Re: Issue printing baseline info Costas..Aravidis - Mon Jun 06 10:42:50 EDT 2016 If you are looking for the baseline set then the user and the date of the baselines within the baseline set can be taken from the baseline set. If you want to see the user and the date for the baseline then you need to get the version of the module (baseline) from the baseline set and then loop through the module's baselines to get the baseline needed to see the user and the date. But the user and the date of the baseline within the set it will be the same as the user and the date of the baseline set. you still would need to load the module before getting all the info. |